package xyz.yuanjilu.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import xyz.yuanjilu.dao.CommunityDao;
import xyz.yuanjilu.entity.CommunityEntity;
import xyz.yuanjilu.service.CommunityService;



@Service("communityService")
public class CommunityServiceImpl implements CommunityService {
	@Autowired
	private CommunityDao communityDao;
	
	@Override
	public CommunityEntity queryObject(Long id){
		return communityDao.queryObject(id);
	}
	
	@Override
	public List<CommunityEntity> queryList(Map<String, Object> map){
		return communityDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return communityDao.queryTotal(map);
	}
	
	@Override
	public void save(CommunityEntity community){
		community.setCreateTime(new Date());
		communityDao.save(community);
	}
	
	@Override
	public void update(CommunityEntity community){
		communityDao.update(community);
	}
	
	@Override
	public void delete(Long id){
		communityDao.delete(id);
	}
	
	@Override
	public void deleteBatch(Long[] ids){
		communityDao.deleteBatch(ids);
	}
	
}
